rm -rf ./output
mkdir -p ./output

cd tool/bootloader/imx-bootlets-src-10.12.01/
rm ./u-boot
rm ./uImage
rm ./imx28_ivt_linux.sb
rm ./imx28_ivt_uboot.sb
cd ../../../

cd rootfs
sudo mkfs.ubifs -r rootfs  -m 2048 -e 126976 -c 864 -o ubifs.img
sudo ubinize -o ubi.img -m 2048 -p 128KiB -s 512 ubinize.cfg
mv ubifs.img ../output/rootfs.ubifs
rm ./ubifs.img
cd ../

cd u-boot-2015.10-rc1/
export CROSS_COMPILE=arm-fsl-linux-gnueabi-
export ARCH=arm
make clean
make distclean
make mx28evk_nand_config
make
cd ../

cd linux-2.6.35.3/
make clean
make uImage
make zImage
cd ../

cd tool/bootloader/imx-bootlets-src-10.12.01/
cp ../../../u-boot-2015.10-rc1/u-boot ./
cp ../../../linux-2.6.35.3/arch/arm/boot/uImage ./
cp ../../../linux-2.6.35.3/arch/arm/boot/zImage ./
./build
cp uImage imx28_ivt_linux.sb imx28_ivt_uboot.sb ../../../output/
cp uImage imx28_ivt_linux.sb imx28_ivt_uboot.sb /mnt/EasyARM_V1.03/image/
